class CPU:
    pass

class Disk:
    pass

class Computer:
    def __init__(self, cpu, disk):
        self.cpu = cpu
        self.disk = disk



cpu = CPU()
disk = Disk()
computer1 = Computer(cpu, disk)

import copy
computer2 = copy.copy(computer1)        # 浅拷贝
computer3 = copy.deepcopy(computer1)   # 深拷贝
print(computer1.__dict__)
print(computer2.__dict__)
print(computer3.__dict__)